from tools.GetEdition import EDITION
import os
from tools.ReadJson import read_json
from tools.Request_General import BaseAPI

"""
接口url
"""
path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data', 'approvalProcessModuleData.json')
SPACE_PATH = read_json(path=path, app_name="space")

APPROVAL_PROCESS_MOD_VAR = EDITION().get_module_ver("PCS", "1.0")
APPROVAL_PROCESS_SERVER = EDITION().get_edition("PCS", "1.0")
MYSQLDATA_MOD_VAR = EDITION().get_module_ver("DAT_MYSQL", "1.0")

"""
审批流服务相关的接口
"""


class ApprovalProcess(BaseAPI):
    """
    审批流组件
    """

    def operation_init(self, payload):
        """
        获取初始审批操作信息
        """
        r = self.request_send(json=payload)
        return r

    def delete_record(self, payload):
        """
        删除审批记录接口
        """
        r = self.request_send(json=payload)
        return r

    def get_record(self, payload):
        """
        查询审批记录接口
        """
        r = self.request_send(json=payload)
        return r

    def record(self, payload):
        """
        审批操作接口
        """
        r = self.request_send(json=payload)
        return r

    def configure_pt(self, payload):
        """
        审批流新建/保存接口
        """
        r = self.request_send(json=payload)
        return r

    def configure(self, par):
        """
        审批流查询接口
        """
        r = self.request_send(params=par)
        return r


if __name__ == '__main__':
    pass
